﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Recovery.aspx.cs" Inherits="Recovery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<%--<script src="Scripts/jquery.min.js" type="text/javascript" > </script>--%>
     <link href="js/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.validationEngine.js" type="text/javascript"></script>
    <script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
    <script  type="text/javascript">
        function customValidate(field, rules, i, options) {
            var pattern = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);
            var match = pattern.exec(field.val());
            if (field.val() == "") {
                return true;
            }
            else if (match == null) {
                return options.allrules.email.alertText;
            }
        }

        function validateCheckbox() {
            //var message = document.getElementById('<%=errorMessage.ClientID %>').innerHTML;
//            if (!$('#check1').is(':checked') && !$('#check2').is(':checked') && !$('#check3').is(':checked')) {
//                document.getElementById('<%=errorMessage.ClientID %>').innerHTML = 'Please select one of the following options.'
//                //$('#idError').show();
//                return false;
//            }

            var a = document.getElementById('<%=txtEmailAddress.ClientID %>').value;
            if (a == '') {
                document.getElementById('<%=errorMessage.ClientID %>').innerHTML = 'Please enter a valid email address.'
                return false;
            }

            var pattern = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);
            var match = pattern.exec(a);
            if (match == null) {
                document.getElementById('<%=errorMessage.ClientID %>').innerHTML = 'Please enter a valid email address.';
                return false;
            }
        }
    </script>
<script>
    $(document).ready(function () {
        jQuery(".form").validationEngine({ scroll: false, focusFirstField: false });
//        $('#check1').change(
//        function () {
//            if ($(this).is(':checked')) {
//                // append goes here
//                $("#divText3").hide();
//                $("#divText1").show();
//            }
//        });

//        $('#check2').change(
//        function () {
//            if ($(this).is(':checked')) {
//                // append goes here
//                $("#divText1").hide();
//                $("#divText3").hide();
//            }
//        });
//        $('#check3').change(
//        function () {
//            if ($(this).is(':checked')) {
//                $("#divText1").hide();
//                $("#divText3").show();
//            }
//        });

    });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
  	<div class="bg01">
    	<div class="bg02">
        	<div class="bg15 clearfix" style="height:410px;">
            <div class="clearfix w50pc">
            <p class="titlerecovery">Having trouble signing in?</p>
            <p id="idError" class="errormsg"><asp:Label runat="server" ID="errorMessage"></asp:Label>
            </p>
                <form action="" method="get">
               	  <p id="text1" class="mar_b10">I don't know my password</p>
                  <div id="divText1" >
                    <p class="mar_b10" >To reset your password, enter the email address you use to sign in to PlanItMeal. This can be your email address.</p>
                    <p class="mar_b10">Email address</p>
                    <p class="txt_email mar_b10"><input name="Emai address" id="txtEmailAddress" runat="server" type="text" class="field-textbox1" size="30" /></p>
                    </div>
                  	<%--<p class="mar_b10"><input id="check2" name="radio" type="radio" value="" /> I don't know my username</p>
                  	<p class="mar_b10"><input id="check3" name="radio" type="radio" value="" /> I'm having other problems signing in</p>
                    <div id="divText3" style="display:none;">
                    <p  class="font_11">Enter the username you use to sign in to PlanItMeal. This can be your email address.</p>
                    <p class="txt_email">Email address</p>
                    <p class="txt_email mar_b25"><input name="Emai address"  type="text" class="field-textbox1" size="30" /></p>
                    </div>--%>
                    <p><asp:Button runat="server" ID="btn_submit" 
                             OnClientClick="return validateCheckbox();" alt="Submit" Text="Submit" CssClass="button-form"
                            onclick="btn_submit_Click" /></p>
                </form>
            </div>
            </div>
        </div>
     <%-- <div style="clear:both"></div>--%>
</div>
</asp:Content>

